package com.block.controller;

import com.block.common.Msg;
import com.block.entity.UserInfo;
import com.block.service.UserInfoService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

@Controller
@RequestMapping("/userinfo")
public class UserinfoController {

    @Resource
    private UserInfoService userInfoService;

    //登录
    @RequestMapping(value = "/insertUser",method = RequestMethod.POST)
    @ResponseBody
    public Msg insertUser(UserInfo userInfo){
        return userInfoService.insertUser(userInfo);
    }

    //注册
    @RequestMapping(value = "/updateUser",method = RequestMethod.POST)
    @ResponseBody
    public Msg updateUser(UserInfo userInfo){
        return userInfoService.updateUser(userInfo);
    }

}
